package com.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.Product_commentDao;
import com.entity.Product_comment;
import com.entity.view.Product_commentView;
import com.entity.vo.Product_commentVO;
import com.service.Product_commentService;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("product_commentService")
public class Product_commentServiceImpl extends ServiceImpl<Product_commentDao, Product_comment> implements Product_commentService {


    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<Product_comment> page = this.selectPage(
                new Query<Product_comment>(params).getPage(),
                new EntityWrapper<Product_comment>()
        );
        return new PageUtils(page);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params, Wrapper<Product_comment> wrapper) {
        Page<Product_commentView> page =new Query<Product_commentView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,wrapper));
        PageUtils pageUtil = new PageUtils(page);
        return pageUtil;
    }

    @Override
    public List<Product_commentVO> selectListVO(Wrapper<Product_comment> wrapper) {
        return baseMapper.selectListVO(wrapper);
    }

    @Override
    public Product_commentVO selectVO(Wrapper<Product_comment> wrapper) {
        return baseMapper.selectVO(wrapper);
    }

    @Override
    public List<Product_commentView> selectListView(Wrapper<Product_comment> wrapper) {
        return baseMapper.selectListView(wrapper);
    }

    @Override
    public Product_commentView selectView(Wrapper<Product_comment> wrapper) {
        return baseMapper.selectView(wrapper);
    }


}
